package com.android.aishangauction.model.member;

import com.android.aishangauction.utils.MyLog;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.zhy.http.okhttp.callback.Callback;

import okhttp3.Response;

/**
 * 自定义回调，每个bean都写一个
 * Created by wzq on 2016/9/1.
 */
public abstract class DirectBuyFirmOrderDataCallback extends Callback<DirectBuyFirmOrderData> {

    @Override
    public DirectBuyFirmOrderData parseNetworkResponse(Response response, int id) throws Exception {
        String string = response.body().string();
        MyLog.e("DirectBuyFirmOrderData ",string);
        GsonBuilder builder = new GsonBuilder();
        builder.registerTypeAdapter(DirectBuyFirmOrderData.class, new DirectBuyFirmOrderData.DirectBuyFirmOrderDataDeserializer());
        Gson gson = builder.create();
        DirectBuyFirmOrderData data = gson.fromJson(string, DirectBuyFirmOrderData.class);
    //    MyLog.e("DirectBuyFirmOrderData1",data.getData().getToken());
        return data;
    }


}
